from django.urls import path
from book.views import index,shop,login,get_json,get_header_info,register,weibo,set_cookie,get_cookie


from django.urls.converters import IntConverter

class MobileConverter:
    regex = '1[3-9]\d{9}'

    # to_python 正则匹配成功之后的数据 有什么操作
    def to_python(self, value):

        return int(value)

from django.urls.converters import register_converter

register_converter(MobileConverter, 'mm')


    # def to_url(self, value):
    #     return str(value)

urlpatterns = {



    path('index/', index),

    path('register/<mm:mobile>/', register),

    # path('13000/13001/', shop),
    path('<int:pro_id>/<int:city_id>/', shop),

    path('login/', login),

    path('json/', get_json),

    path('header/', get_header_info),

    # path('http_res/', http_res)

    path('weibo/', weibo),

    # cookie
    path('set_cookie/', set_cookie),

    path('get_cookie/', get_cookie)
}